#!/usr/bin/env python3

import argparse
import multiprocessing

parser = argparse.ArgumentParser(description="Crack a homophonic type cipher using the given wordlist", epilog="Whitespaces in the cipher file are stripped and symbols are assumed")
parser.add_argument("-f", "--file", help="File to read ciphertext/symbols from")
parser.add_argument("-w", "--wordlist", help="Wordlist to use for hill climbing")
parser.add_argument("-t", "--threads", help="Thread count for checking", type=int, default=1)
parser.add_argument("-s", "--skip", help="Number of symbols that may be skipped", type=int, default=1)
parser.add_argument("-n", "--nomulti", help="Disallow multi matches, ie, speed up monoalphabetic ciphers", action="count")
parser.add_argument("-l", "--lock", help="Lock symbol to letter [symbol:letter], can be specified multiple times", action="append")
parser.add_argument("-c", "--count", help="Number of best sollutions to save", type=int, default=5)
parser.add_argument("-r", "--resume", help="Save and load session information on load and exit")
parser.add_argument("-m", "--metric", help="Metric to use for solution, 1 - Word Count, 2 - Consecutive letter count, 3 - Total letter count, 4 - IOC", type=int, default=1)
parser.add_argument("-i", "--ioc", help="Value of IOC to compare against, default is 1.73, corresponding to english", type=int, default=1.73)
parser.add_argument("-k", "--kill", help="Don't start threads, usefull when using with -l and -r for test runs")
parser.add_argument("-v", "--verbose", help="Verbose output, can be used up to 3 times", action="count")
args = parser.parse_args()
